var dialog = {
	title:"提示",
	content:"",
	color:"blue",
	confirm:function(objects,callback){
		this.init(objects);
		
		$(".confirm-dialog .confirms-cancle").unbind("click");	
		$(".confirm-dialog .alert-confirm").unbind("click");	
		$(".confirm-dialog .confirms-cancle").bind("click",function(){
			$(".confirm-dialog").css("visibility","hidden");
		});
		$(".confirm-dialog .alert-confirm").bind("click",function(){
			$(".confirm-dialog").css("visibility","hidden");
			if(callback!=null){
				
				callback();
			}
		});
		$(".confirm-dialog").css("visibility","visible");
	},
	alert:function(objects,callback){
		this.init(objects);
		
		$(".alert-dialog .alert-confirm").unbind("click");	
		$(".alert-dialog .alert-confirm").bind("click",function(){
			$(".alert-dialog").css("visibility","hidden");
			if(callback!=null){
				
				callback();
			}
		});
		
		$(".alert-dialog").css("visibility","visible");
	},
	reset:function(){
		this.title="提示";
		this.content="";
		this.color="blue";
	},
	init:function(objects){
		this.reset();
		var obj = this;
		
		if(typeof objects == "object"){
			if(objects.color){
				obj.color=objects.color;
			}
			if(objects.title){
				obj.title=objects.title;
			}
			if(objects.content){
				obj.content=objects.content;
			}
		}else{
			
			if(objects){
				obj.content = objects;
			}
		}
		obj.html();
	},
	html:function(){
		$(".alert-or-confirm-dialog .alert-confirm").css("background",this.color);
		$(".alert-or-confirm-dialog .dialogs-title").html('<span style="color:'+this.color+'">'+this.title+'</span>');
		$(".alert-or-confirm-dialog .contents").html(this.content); 
	}
	
	
	
	
};
dialog.confirm({color:"red",content:"你好"},function(){
	alert()
});